<link rel="stylesheet" href="../addons/jy_merch/css/mobile.css?v=1">
<div class='fui-page fui-page-current'>
    <div class="fui-header fui-header-success">
        <div class="fui-header-left"></div>
        <div class="title">我的小店</div>
        <div class="fui-header-right">
			<a ng-click="pagedata.showmerchs=true"><i class="icon icon-qiehuan" style="font-size:0.6rem"></i> 切换商户</a>
		</div>
    </div>
    <div class='fui-content'>
        <div class="headinfo">
            <div class="userinfo" style="height:auto">
                <a class="fui-list external" >
                    <div class="fui-list-media">
                        <img ng-src="{{tomedia(pagedata.item.logo) || '../core/resource/images/nopic.jpg'}} ">
                    </div>
                    <div class="fui-list-info">
                        <div class="title" style="line-height:1.5rem">{{pagedata.item.merchname}} 
							<span ng-if="pagedata.item.is_yajinfee>0.00" ng-click="access_json('jy_merch/manage.yajin_log/')" class="fui-tag-red-o" style="margin-top:-0.2rem;padding:0.06rem 0.3rem;">已缴纳 ￥{{pagedata.item.is_yajinfee}}</span> 
							<span ng-if="pagedata.basic.yajin_open==1 && (!pagedata.item.is_yajinfee || pagedata.item.is_yajinfee<=0.00)" class="fui-tag-red-o" ng-click="access_json('jy_merch/manage.setyajin/')" style="margin-top:-0.2rem;padding:0.06rem 0.3rem;">缴纳保证金</span>
						</div>
						<div class="jylabel jylabel-switch-label">
								<span ng-class="{'jylabel-switch':1,'active':pagedata.isopenvoice==1}" ng-click="pagedata.isopenvoice=1;pagedata.openvoice(1);">开铃声</span>
								<span ng-class="{'jylabel-switch':1,'active':pagedata.isopenvoice!=1}" ng-click="pagedata.isopenvoice=0;pagedata.openvoice(0)">关铃声</span>
						</div>
                        <div class="text">{{pagedata.item.desc}}</div>
						<div class="price">待结算：{{pagedata.clearfee0 || '0.00'}} (扣佣金：{{pagedata.commission_money0 || '0.00'}}) <span class="fui-tag-red-o" ng-click="access_json('jy_merch/manage.apply_add/')" style="margin-top:-0.2rem;padding:0.06rem 0.3rem;">结算</span></div>
					</div>
                </a>
                
            </div>
        </div>
            <div class="fui-cell-group">
                <a class="fui-cell external" ng-click="access_json('jy_merch/manage.order_list/')">
                    <div class="fui-cell-icon"><i class="icon icon-rejectedorder"></i></div>
                    <div class="fui-cell-text">订单管理</div>
                    <div class="fui-cell-remark">全部</div>
                </a>
            </div>
            <div class="fui-block-group col-3">
               
                    <a class="fui-block-child" ng-click="access_json('jy_merch/manage.order_list//status=1')">
                        <div class="icon text-blue"><i class="weui_icon_msg weui_icon_waiting"></i></div>
                        <div class="title">待发货</div>
                        <div class="text"><span id="status_1">{{pagedata.status1}}</span> 单</div>
                    </a>
                
                    <a class="fui-block-child" ng-click="access_json('jy_merch/manage.order_list//status=0')">
                        <div class="icon text-yellow"><i class="icon icon-dollar"></i></div>
                        <div class="title">待付款</div>
                        <div class="text"><span id="status_0">{{pagedata.ispay}}</span> 笔</div>
                    </a>
               
                    <a class="fui-block-child" ng-click="access_json('jy_merch/manage.order_list//status=2')">
                        <div class="icon text-orange">
                            <i class="icon icon-rejectedorder"></i>
                        </div>
                        <div class="title">待收货</div>
                        <div class="text"><span id="status_4">{{pagedata.status2}}</span> 笔</div>
                    </a>
                
            </div>
       
		<div class="fui-cell-group fui-cell-click mod-group">
					<a class="fui-cell" href="javascript:;" ng-click="access_json('jy_merch/manage.refund/')">
								<div class="fui-cell-icon"><i class="icon icon-caifua"></i></div>
								<div class="fui-cell-text">
												退款管理
								</div>
								<div class="fui-cell-remark"></div>
					</a>
		</div>
		<div class="fui-cell-group fui-cell-click mod-group">
					<a class="fui-cell" href="javascript:;" ng-click="access_json('jy_merch/manage.addwxapp/')">
								<div class="fui-cell-icon"><i class="icon icon-xiaochengxu"></i></div>
								<div class="fui-cell-text">
												申请小店小程序
								</div>
								<div class="fui-cell-remark"></div>
					</a>
		</div>
        <div class="fui-cell-group">
            <div class="fui-cell">
                <div class="fui-cell-icon">
                    <i class="icon icon-dianpu"></i>
                </div>
                <div class="fui-cell-text">商城管理</div>
            </div>
        </div>
        <div class="fui-block-group col-3">
           
                <a class="fui-block-child" ng-click="access_json('jy_area_dai/mygoods/')">
                    <div class="icon text-yellow">
                        <i class="icon icon-tianmaopaidui"></i>
                    </div>
                    <div class="title">商品管理</div>
                    <div class="text"><span id="goods_count">{{pagedata.goods || 0}}</span> 个</div>
                </a>
				<a class="fui-block-child" ng-click="access_json(pagedata.merchurl)">
                    <div class="icon text-yellow">
                        <i class="icon icon-shuru"></i>
                    </div>
                    <div class="title">前往进货</div>
                     <div class="text"></div>
                </a>
                <a class="fui-block-child" ng-click="access_json('jy_area_dai/manage.shop/')">
                    <div class="icon text-orange">
                        <i class="icon icon-set"></i>
                    </div>
                    <div class="title">店铺设置</div>
                    <div class="text"></div>
                </a>
				<a class="fui-block-child" ng-click="access_json('jy_merch/merch/')">
                    <div class="icon text-orange">
                        <i class="icon icon-dianpu"></i>
                    </div>
                    <div class="title">店铺入口</div>
                    <div class="text"></div>
                </a>
        </div>
		<div class="fui-cell-group" style="width:100%">
            <div class="fui-cell">
                <div class="fui-cell-icon">
                    <i class="icon icon-data"></i>
                </div>
                <div class="fui-cell-text">我的核销</div>
            </div>
        </div>
        <div class="fui-block-group col-3 l-f" style="height:auto;width:100%;margin-top:0.15rem">          
                <div ng-click="access_json('jy_merch/verify.index/')" class="fui-block-child">
                    <div class="icon text-yellow">
                        <i class="icon jinyunicon icon-dingdan"></i>
                    </div>
                    <div class="title">订单核销</div>
                    <div class="text"><span id="goods_count">{{pagedata.verifynum || 0}}</span> 个</div>
                </div>
				<div ng-click="access_json('jy_merch/verify.verifygoods/')" class="fui-block-child">
                    <div class="icon text-yellow">
                        <i class="icon jinyunicon icon-dingdan"></i>
                    </div>
                    <div class="title">计次核销</div>
                    <div class="text"><span id="goods_count">{{pagedata.verifygoodsnum || 0}}</span> 个</div>
                </div>
				<div ng-click="access_json('jy_merch/verify.selfindex/')" class="fui-block-child">
                    <div class="icon text-yellow">
                        <i class="icon jinyunicon icon-dingdan"></i>
                    </div>
                    <div class="title">自提核销</div>
                    <div class="text"><span id="goods_count">{{pagedata.selfverifynum || 0}}</span> 个</div>
                </div>
        </div>
        <div class="fui-title center">更多设置请至PC端后台</div>
		<div class='btn btn-success block btn-submit' href="javascript:" ng-click="post_json('core/member.logout/')">退出登录</div>
    </div>
</div>
<div ng-if="pagedata.showmerchs" class="popup">
	<div class="popup-body">
		<div class="popup-bottom">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showmerchs=false"></i>
			<div class="fui-list-group"  id="carrierInfo" style="border-radius: 0.5rem;background:#fff;margin: 0">
					<a class="fui-list"  ng-repeat="item in pagedata.merchs" href="javascript:;" ng-click="access_json('jy_merch/manage.index//merchid='+item.id)">
						<div class="fui-list-media">
							<i class="icon icon-map"></i>
						</div>
						<div class="fui-list-inner">
							<div class="subtitle" >
								<span class='realname'>{{item.merchname}}</span>
							</div>
							<div class="text address">地址：{{item.address}}</div>
						</div>
						<div class="fui-list-angle">
							<div class="angle"></div>
						</div>
					</a>
			</div>
			<div class="fui-navbar">
				<a class="nav-item btn cartbtn" ng-click="access_json('jy_merch/register/get/add=1')">添加商户</a>
				<a class="nav-item btn buybtn" ng-click="post_json('core/member.logout/')">切换账户</a>
			</div>
		</div>
	</div>
</div>
<div ng-include="sys_html('common/pluginnav',true)"></div>
<audio id="openvoice" controls preload="auto" style="display:none;">
	<source src="../core/resource/images/neworder.mp3"></source>
</audio>
<script>
scope.pagedata.openvoice=function(type){
	var voicetime = 0;
    var openvoice;
	scope.post_json('jy_merch/manage.shop/openvoice/isopenvoice='+scope.pagedata.isopenvoice,{},function(res){
	});
	if(type==1){
		 openvoice = setInterval(() => {
			if(scope.pagedata.isopenvoice!=1){
				clearInterval(openvoice);
				return false;
			}
			scope.get('jy_merch/order.list/getnew/merchid='+scope.pagedata.item.id,function(res){
						console.log('openvoice');console.log(res);
						if(res!='none'){
							voicetime ++;
							$("#openvoice")[0].play();
						}
			});
		}, 5000);
	}
}
</script>